<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>遥控器中心按钮</title>
    <style>
      body {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100vh;
        background-color: #f0f0f0;
        font-family: Arial, sans-serif;
      }

      .remote-control {
        position: relative;
        width: 200px;
        height: 200px;
      }

      .center-button {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 60px;
        height: 60px;
        background-color: #333;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        color: white;
        font-weight: bold;
        cursor: pointer;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
        z-index: 10;
        user-select: none;
      }

      .center-button:active {
        transform: translate(-50%, -50%) scale(0.95);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
      }

      .directional-button {
        position: absolute;
        width: 50px;
        height: 50px;
        background-color: #555;
        border-radius: 8px;
        display: flex;
        justify-content: center;
        align-items: center;
        color: white;
        font-weight: bold;
        cursor: pointer;
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
        user-select: none;
      }

      /* .directional-button:active {
        transform: scale(0.95);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
      } */

      .up {
        top: 0;
        left: 50%;
        transform: translateX(-50%);
      }
      .up:active {
        transform: translate(-50%, -50%) scale(0.95);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
      }

      .down {
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
      }
      .down:active {
        transform: translate(-50%, 50%) scale(0.95);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
      }

      .left {
        left: 0;
        top: 50%;
        transform: translateY(-50%);
      }
      .left:active {
        transform: translate(-50%, -50%) scale(0.95);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
      }

      .right {
        right: 0;
        top: 50%;
        transform: translateY(-50%);
      }
      .right:active {
        transform: translate(50%, -50%) scale(0.95);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
      }
    </style>
  </head>
  <body>
    <div class="remote-control">
      <div class="directional-button up">↑</div>
      <div class="directional-button down">↓</div>
      <div class="directional-button left">←</div>
      <div class="directional-button right">→</div>
      <div class="center-button">OK</div>
    </div>

    <script>
      // 添加按钮点击事件
      document.querySelector('.up').addEventListener('click', () => {
        console.log('上按钮被点击')
      })

      document.querySelector('.down').addEventListener('click', () => {
        console.log('下按钮被点击')
      })

      document.querySelector('.left').addEventListener('click', () => {
        console.log('左按钮被点击')
      })

      document.querySelector('.right').addEventListener('click', () => {
        console.log('右按钮被点击')
      })

      document.querySelector('.center-button').addEventListener('click', () => {
        console.log('确认按钮被点击')
      })
    </script>
  </body>
</html>
